//
//  Landmark.swift
//  ChinaLandmark
//
//  Created by iGhibli on 2020/12/17.
//

import Foundation
import CoreLocation

struct Landmark: Identifiable {
    var id: Int
    var category: String
    var name: String
    var city: String
    var province: String
    
    var latitue: Double
    var longitude: Double
    var locationCoordinate: CLLocationCoordinate2D {
        CLLocationCoordinate2D(latitude: latitue, longitude: longitude)
    }
    
    var imageName: String
    
    var isFavorite: Bool
    var isFeatured: Bool
}

let landmarks = [
    Landmark(id: 1, category: "古迹", name: "故宫", city: "北京", province: "北京市", latitue: 39.9167240, longitude: 116.3966869, imageName: "tiananmen", isFavorite: true, isFeatured: true),
    Landmark(id: 2, category: "现代建筑", name: "东方明珠", city: "上海", province: "上海市", latitue: 31.245387, longitude: 121.506383, imageName: "dongfangmingzhu", isFavorite: false, isFeatured: true),
    Landmark(id: 3, category: "现代建筑", name: "广州塔", city: "广州", province: "广东省", latitue: 23.108601501032922, longitude: 113.32319699734495, imageName: "xiaomanyao", isFavorite: true, isFeatured: false),
    Landmark(id: 4, category: "现代建筑", name: "金融中心", city: "深圳", province: "广东省", latitue: 22.542002, longitude: 114.114365, imageName: "jinrongzhongxin", isFavorite: false, isFeatured: false),
    Landmark(id: 5, category: "现代建筑", name: "天际线", city: "香港", province: "香港特别行政区", latitue: 22.290419, longitude: 114.177292, imageName: "skyline", isFavorite: true, isFeatured: false),
    Landmark(id: 6, category: "自然景观", name: "九寨沟", city: "九寨沟县", province: "四川省", latitue: 33.26142, longitude: 104.23567, imageName: "jiuzhaigou", isFavorite: true, isFeatured: true),
    Landmark(id: 7, category: "自然景观", name: "日月潭", city: "南投县", province: "台湾省", latitue: 23.863092, longitude: 120.907898, imageName: "riyuetan", isFavorite: false, isFeatured: true),
    Landmark(id: 8, category: "自然景观", name: "西湖", city: "杭州", province: "浙江省", latitue: 30.24553235318667, longitude: 120.14307023025516, imageName: "xihu", isFavorite: false, isFeatured: false),
    Landmark(id: 9, category: "古迹", name: "布达拉宫", city: "拉萨", province: "西藏自治区", latitue: 29.654266, longitude: 91.118538, imageName: "budalagong", isFavorite: false, isFeatured: false),
    Landmark(id: 10, category: "古迹", name: "中山陵", city: "南京", province: "江苏省", latitue: 32.062294, longitude: 118.853348, imageName: "zhongshanling", isFavorite: false, isFeatured: false),
]

let featuredLandmarks = landmarks.filter { $0.isFeatured }
